package com.cn.sl.server.common.enumerate

import com.fasterxml.jackson.annotation.JsonCreator

enum class PageOrder(val value: String) {
    DESC("DESC"),
    ASC("ASC");

    companion object {
        @JsonCreator
        @JvmStatic
        fun create(code: String): PageOrder? {
            return if (code.equals("DESC", true) || code.equals("DESCEND", true)) {
                DESC
            } else if (code.equals("ASC", true) || code.equals("ASCEND", true)) {
                ASC
            } else {
                null
            }
        }
    }
}